import request from "@/utils/request.ts";

enum API {
  BASE_URL = '/admin/notice'
}

// 获取公告列表
export const getNoticeList = (params: any) => request({
  method: 'GET',
  url: API.BASE_URL,
  params: params
})

// 添加公告
export const postNotice = (data: any) => request({
  method: 'POST',
  url: API.BASE_URL,
  data
})

// 编辑公告
export const editNotice = (id: string, data: any) => request({
  method: 'PUT',
  url: API.BASE_URL + `/${id}`,
  data
})

// 删除公告
export const deleteNotice = (id: string) => request({
  method: 'DELETE',
  url: API.BASE_URL + `/${id}`
})

